home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Lists Lingo.dir / Scripts_7_scrollBitmap Handler.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  1.0 KB  |  28 lines

  1. on scrollBitmap vDirection
  2.   global gStartPosition
  3.   if vDirection = 1 then
  4.     set vBitmapSprite to the clickOn - 1
  5.   else
  6.     set vBitmapSprite to the clickOn - 2
  7.   end if
  8.   if the puppet of sprite vBitmapSprite = 0 then
  9.     set gStartPosition to the locV of sprite vBitmapSprite
  10.     puppetSprite(vBitmapSprite, 1)
  11.   end if
  12.   set vHeight to the height of sprite vBitmapSprite
  13.   set vScrollAmount to 100
  14.   set vUpperLimit to gStartPosition + vScrollAmount - vHeight
  15.   set vLowerLImit to gStartPosition
  16.   if the puppet of sprite vBitmapSprite = 1 then
  17.     if (the locV of sprite vBitmapSprite + (vScrollAmount * vDirection)) <= vUpperLimit then
  18.       set the locV of sprite vBitmapSprite to vUpperLimit
  19.     else
  20.       if (the locV of sprite vBitmapSprite + (vScrollAmount * vDirection)) >= vLowerLImit then
  21.         set the locV of sprite vBitmapSprite to vLowerLImit
  22.       else
  23.         set the locV of sprite vBitmapSprite to the locV of sprite vBitmapSprite + (vScrollAmount * vDirection)
  24.       end if
  25.     end if
  26.   end if
  27. end
  28.